//
//  ACSCollectionViewCell.m
//  HomeIn
//
//  Created by 张涛 on 15/11/8.
//  Copyright © 2015年 ZZP. All rights reserved.
//

#import "ACSCollectionViewCell.h"
#import "ACSModel.h"
@implementation ACSCollectionViewCell

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        [self creat];
    }
    return self;
}
-(void)creat
{
    self.coverImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0 * WIDTHSCALE , 0 * HEIGHTSCALE, 365 * WIDTHSCALE, 200 * HEIGHTSCALE)];
    self.coverImageView.backgroundColor = [UIColor clearColor];
    [self.contentView addSubview:self.coverImageView];
    //
    self.labelTitle = [[UILabel alloc]initWithFrame:CGRectMake(15 * WIDTHSCALE, 200 * HEIGHTSCALE, 365 * WIDTHSCALE, 30 *HEIGHTSCALE)];
    self.labelTitle.font = [UIFont fontWithName:@"Arial" size:16];
    //字体在Label上的位置
    [self.labelTitle setTextAlignment:NSTextAlignmentCenter];
    self.labelTitle.backgroundColor = [UIColor clearColor];
    [self.contentView addSubview:self.labelTitle];
    
    
}
-(void)setModel:(ACSModel *)model
{
    _model = model;
    [self.coverImageView sd_setImageWithURL:[NSURL URLWithString:_model.cover_image_url] placeholderImage:nil];
    //
    self.labelTitle.text = _model.title;
  
}
@end
